import 'package:json_annotation/json_annotation.dart';

part 'message.g.dart';

@JsonSerializable()
class MessageOrderModel {
  String addTime;

  String title;

  String info;

  String orderNo;

  MessageOrderModel(
      {required this.addTime, required this.title, required this.info, required this.orderNo});

  factory MessageOrderModel.fromJson(Map<String, dynamic> json) =>
      _$MessageOrderModelFromJson(json);

  Map<String, dynamic> toJson() => _$MessageOrderModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}

@JsonSerializable()
class MessageInteractModel {

  String avatar;

  String nickname;

  String timeStr;

  String tip;

  String? info;

  String content;

  List<String> imgs;

  MessageInteractModel({ required this.avatar, required this.nickname, required this.timeStr, required this.tip, this.info, required this.content, this.imgs = const [] });

  factory MessageInteractModel.fromJson(Map<String, dynamic> json) =>
      _$MessageInteractModelFromJson(json);

  Map<String, dynamic> toJson() => _$MessageInteractModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}

@JsonSerializable()
class MessageSystemModel {
  String timeStr;

  String content;

  MessageSystemModel({ required this.timeStr, required this.content });

  factory MessageSystemModel.fromJson(Map<String, dynamic> json) =>
      _$MessageSystemModelFromJson(json);

  Map<String, dynamic> toJson() => _$MessageSystemModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}